<template>
<h2>父级组件</h2>
<button @click="isShow=!isShow">切换显示</button>
<hr>
<Child v-if="isShow"/>
</template>

<script>
import {defineComponent,ref} from 'vue'
import Child from './components/Child'
export default defineComponent({
  name: 'App',
  components:{
    Child,
  },
  setup(){
    const isShow = ref(true)
    return {
      isShow
    }
  }

})
</script>

<style lang="less" scoped>

</style>
